package com.chenl.provider.DEMOS.Spring.幂等注解;

import com.chenl.provider.DTO.Student;
import com.chenl.provider.DTO.UserInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/mideng")
public class MiDengController {
    @Autowired
    ConMiDengFeign conMiDengFeign;


    @GetMapping("/test")
    public String testMethod(){
        System.out.println("pro开始");
        UserInfo userInfo = new UserInfo();
        Student student=new Student();
        student.setAge("66654321");
        userInfo.setStudent(student);
        for (int i = 0; i < 3; i++) {
            String test = conMiDengFeign.test(userInfo);
            System.out.println("调用幂等接口返回:"+test);
        }
        System.out.println("pro结束");
        return "okk";
    }

    @GetMapping("/test2")
    public String testMethod2(){
        log.info("pro开始2");
        log.info("pro结束2");
        return "okk2";
    }
}
